{
  "cells": [
    {
      "cell_type": "markdown",
      "source": [
        "# RANSAC Regression"
      ],
      "metadata": {}
    },
    {
      "cell_type": "markdown",
      "source": [
        "Random Sample Consensus (RANSAC) Regression is an algorithm randomly selects a random amount of samples to be inliers in the model while removing outliers to fit the model."
      ],
      "metadata": {
        "nteract": {
          "transient": {
            "deleting": false
          }
        }
      }
    },
    {
      "cell_type": "code",
      "source": [
        "import numpy as np\n",
        "import matplotlib.pyplot as plt\n",
        "import pandas as pd\n",
        "\n",
        "import warnings\n",
        "warnings.filterwarnings(\"ignore\")\n",
        "\n",
        "# yahoo finance is used to fetch data \n",
        "import yfinance as yf\n",
        "yf.pdr_override()"
      ],
      "outputs": [],
      "execution_count": 1,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false,
        "execution": {
          "iopub.status.busy": "2021-09-12T04:14:52.997Z",
          "iopub.execute_input": "2021-09-12T04:14:53.002Z",
          "shell.execute_reply": "2021-09-12T04:14:53.078Z",
          "iopub.status.idle": "2021-09-12T04:14:53.085Z"
        }
      }
    },
    {
      "cell_type": "code",
      "source": [
        "# input\n",
        "symbol = 'AMD'\n",
        "start = '2014-01-01'\n",
        "end = '2018-08-27'\n",
        "\n",
        "# Read data \n",
        "dataset = yf.download(symbol,start,end)\n",
        "\n",
        "# View Columns\n",
        "dataset.head()"
      ],
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "[*********************100%***********************]  1 of 1 completed\n"
          ]
        },
        {
          "output_type": "execute_result",
          "execution_count": 2,
          "data": {
            "text/plain": "            Open  High   Low  Close  Adj Close    Volume\nDate                                                    \n2014-01-02  3.85  3.98  3.84   3.95       3.95  20548400\n2014-01-03  3.98  4.00  3.88   4.00       4.00  22887200\n2014-01-06  4.01  4.18  3.99   4.13       4.13  42398300\n2014-01-07  4.19  4.25  4.11   4.18       4.18  42932100\n2014-01-08  4.23  4.26  4.14   4.18       4.18  30678700",
            "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>Open</th>\n      <th>High</th>\n      <th>Low</th>\n      <th>Close</th>\n      <th>Adj Close</th>\n      <th>Volume</th>\n    </tr>\n    <tr>\n      <th>Date</th>\n      <th></th>\n      <th></th>\n      <th></th>\n      <th></th>\n      <th></th>\n      <th></th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>2014-01-02</th>\n      <td>3.85</td>\n      <td>3.98</td>\n      <td>3.84</td>\n      <td>3.95</td>\n      <td>3.95</td>\n      <td>20548400</td>\n    </tr>\n    <tr>\n      <th>2014-01-03</th>\n      <td>3.98</td>\n      <td>4.00</td>\n      <td>3.88</td>\n      <td>4.00</td>\n      <td>4.00</td>\n      <td>22887200</td>\n    </tr>\n    <tr>\n      <th>2014-01-06</th>\n      <td>4.01</td>\n      <td>4.18</td>\n      <td>3.99</td>\n      <td>4.13</td>\n      <td>4.13</td>\n      <td>42398300</td>\n    </tr>\n    <tr>\n      <th>2014-01-07</th>\n      <td>4.19</td>\n      <td>4.25</td>\n      <td>4.11</td>\n      <td>4.18</td>\n      <td>4.18</td>\n      <td>42932100</td>\n    </tr>\n    <tr>\n      <th>2014-01-08</th>\n      <td>4.23</td>\n      <td>4.26</td>\n      <td>4.14</td>\n      <td>4.18</td>\n      <td>4.18</td>\n      <td>30678700</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
          },
          "metadata": {}
        }
      ],
      "execution_count": 2,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false,
        "execution": {
          "iopub.status.busy": "2021-09-12T04:14:53.093Z",
          "iopub.execute_input": "2021-09-12T04:14:53.098Z",
          "iopub.status.idle": "2021-09-12T04:14:53.829Z",
          "shell.execute_reply": "2021-09-12T04:14:53.823Z"
        }
      }
    },
    {
      "cell_type": "code",
      "source": [
        "# Create more data\n",
        "dataset['Increase_Decrease'] = np.where(dataset['Volume'].shift(-1) > dataset['Volume'],1,0)\n",
        "dataset['Buy_Sell_on_Open'] = np.where(dataset['Open'].shift(-1) > dataset['Open'],1,-1)\n",
        "dataset['Buy_Sell'] = np.where(dataset['Adj Close'].shift(-1) > dataset['Adj Close'],1,-1)\n",
        "dataset['Return'] = dataset['Adj Close'].pct_change()\n",
        "dataset = dataset.dropna()\n",
        "dataset.head()"
      ],
      "outputs": [
        {
          "output_type": "execute_result",
          "execution_count": 3,
          "data": {
            "text/plain": "            Open  High   Low  Close  Adj Close    Volume  Increase_Decrease  \\\nDate                                                                          \n2014-01-03  3.98  4.00  3.88   4.00       4.00  22887200                  1   \n2014-01-06  4.01  4.18  3.99   4.13       4.13  42398300                  1   \n2014-01-07  4.19  4.25  4.11   4.18       4.18  42932100                  0   \n2014-01-08  4.23  4.26  4.14   4.18       4.18  30678700                  0   \n2014-01-09  4.20  4.23  4.05   4.09       4.09  30667600                  0   \n\n            Buy_Sell_on_Open  Buy_Sell    Return  \nDate                                              \n2014-01-03                 1         1  0.012658  \n2014-01-06                 1         1  0.032500  \n2014-01-07                 1        -1  0.012106  \n2014-01-08                -1        -1  0.000000  \n2014-01-09                -1         1 -0.021531  ",
            "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>Open</th>\n      <th>High</th>\n      <th>Low</th>\n      <th>Close</th>\n      <th>Adj Close</th>\n      <th>Volume</th>\n      <th>Increase_Decrease</th>\n      <th>Buy_Sell_on_Open</th>\n      <th>Buy_Sell</th>\n      <th>Return</th>\n    </tr>\n    <tr>\n      <th>Date</th>\n      <th></th>\n      <th></th>\n      <th></th>\n      <th></th>\n      <th></th>\n      <th></th>\n      <th></th>\n      <th></th>\n      <th></th>\n      <th></th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>2014-01-03</th>\n      <td>3.98</td>\n      <td>4.00</td>\n      <td>3.88</td>\n      <td>4.00</td>\n      <td>4.00</td>\n      <td>22887200</td>\n      <td>1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>0.012658</td>\n    </tr>\n    <tr>\n      <th>2014-01-06</th>\n      <td>4.01</td>\n      <td>4.18</td>\n      <td>3.99</td>\n      <td>4.13</td>\n      <td>4.13</td>\n      <td>42398300</td>\n      <td>1</td>\n      <td>1</td>\n      <td>1</td>\n      <td>0.032500</td>\n    </tr>\n    <tr>\n      <th>2014-01-07</th>\n      <td>4.19</td>\n      <td>4.25</td>\n      <td>4.11</td>\n      <td>4.18</td>\n      <td>4.18</td>\n      <td>42932100</td>\n      <td>0</td>\n      <td>1</td>\n      <td>-1</td>\n      <td>0.012106</td>\n    </tr>\n    <tr>\n      <th>2014-01-08</th>\n      <td>4.23</td>\n      <td>4.26</td>\n      <td>4.14</td>\n      <td>4.18</td>\n      <td>4.18</td>\n      <td>30678700</td>\n      <td>0</td>\n      <td>-1</td>\n      <td>-1</td>\n      <td>0.000000</td>\n    </tr>\n    <tr>\n      <th>2014-01-09</th>\n      <td>4.20</td>\n      <td>4.23</td>\n      <td>4.05</td>\n      <td>4.09</td>\n      <td>4.09</td>\n      <td>30667600</td>\n      <td>0</td>\n      <td>-1</td>\n      <td>1</td>\n      <td>-0.021531</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
          },
          "metadata": {}
        }
      ],
      "execution_count": 3,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false,
        "execution": {
          "iopub.status.busy": "2021-09-12T04:14:53.836Z",
          "iopub.execute_input": "2021-09-12T04:14:53.842Z",
          "shell.execute_reply": "2021-09-12T04:14:53.938Z",
          "iopub.status.idle": "2021-09-12T04:14:53.853Z"
        }
      }
    },
    {
      "cell_type": "code",
      "source": [
        "dataset.shape"
      ],
      "outputs": [
        {
          "output_type": "execute_result",
          "execution_count": 4,
          "data": {
            "text/plain": "(1170, 10)"
          },
          "metadata": {}
        }
      ],
      "execution_count": 4,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false,
        "execution": {
          "iopub.status.busy": "2021-09-12T04:14:53.859Z",
          "iopub.execute_input": "2021-09-12T04:14:53.863Z",
          "iopub.status.idle": "2021-09-12T04:14:53.872Z",
          "shell.execute_reply": "2021-09-12T04:14:53.941Z"
        }
      }
    },
    {
      "cell_type": "code",
      "source": [
        "X = dataset['Open']\n",
        "y = dataset['Adj Close'] "
      ],
      "outputs": [],
      "execution_count": 5,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false,
        "execution": {
          "iopub.status.busy": "2021-09-12T04:14:53.879Z",
          "iopub.execute_input": "2021-09-12T04:14:53.884Z",
          "iopub.status.idle": "2021-09-12T04:14:53.891Z",
          "shell.execute_reply": "2021-09-12T04:14:53.944Z"
        }
      }
    },
    {
      "cell_type": "code",
      "source": [
        "X = np.array(X).reshape(1170,-1)\n",
        "y = np.array(y).reshape(1170,-1)"
      ],
      "outputs": [],
      "execution_count": 6,
      "metadata": {
        "collapsed": true,
        "jupyter": {
          "source_hidden": false,
          "outputs_hidden": false
        },
        "nteract": {
          "transient": {
            "deleting": false
          }
        },
        "execution": {
          "iopub.status.busy": "2021-09-12T04:14:53.898Z",
          "iopub.execute_input": "2021-09-12T04:14:53.902Z",
          "iopub.status.idle": "2021-09-12T04:14:53.909Z",
          "shell.execute_reply": "2021-09-12T04:14:53.947Z"
        }
      }
    },
    {
      "cell_type": "code",
      "source": [
        "from sklearn.linear_model import RANSACRegressor\n",
        "from sklearn.model_selection import cross_val_score\n",
        "from sklearn.model_selection import RepeatedKFold\n",
        "from numpy import absolute, arange"
      ],
      "outputs": [],
      "execution_count": 7,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false,
        "execution": {
          "iopub.status.busy": "2021-09-12T04:14:53.916Z",
          "iopub.execute_input": "2021-09-12T04:14:53.921Z",
          "shell.execute_reply": "2021-09-12T04:14:54.170Z",
          "iopub.status.idle": "2021-09-12T04:14:54.155Z"
        }
      }
    },
    {
      "cell_type": "code",
      "source": [
        "# Define the model\n",
        "model = RANSACRegressor()\n",
        "# Define model evaluation\n",
        "cv = RepeatedKFold(n_splits=10, n_repeats=3, random_state=1)\n",
        "# Evaluate model\n",
        "scores = cross_val_score(model, X, y, scoring='neg_mean_absolute_error', cv=cv, n_jobs=-1)\n",
        "# Change scores to be positive\n",
        "scores = absolute(scores)\n",
        " "
      ],
      "outputs": [],
      "execution_count": 8,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false,
        "execution": {
          "iopub.status.busy": "2021-09-12T04:14:54.162Z",
          "iopub.execute_input": "2021-09-12T04:14:54.187Z",
          "shell.execute_reply": "2021-09-12T04:14:58.842Z",
          "iopub.status.idle": "2021-09-12T04:14:58.830Z"
        }
      }
    },
    {
      "cell_type": "code",
      "source": [
        "model.fit(X, y)\n",
        "plt.scatter(X,y)\n",
        "xaxis = arange(X.min(), X.max(), 0.01)\n",
        "y_pred = model.predict(xaxis.reshape((len(xaxis), 1)))\n",
        "plt.plot(xaxis, y_pred, color='r')\n",
        "plt.title('RANSAC Regression for Stock Price')\n",
        "plt.show()"
      ],
      "outputs": [
        {
          "output_type": "display_data",
          "data": {
            "text/plain": "<Figure size 432x288 with 1 Axes>",
            "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAEICAYAAABPgw/pAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzt3XucjeX6+PHPNWOMMQ5jctga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SikVIDSgK6VUgBBjXK/HWSoXEzkK/F5mF/Q9NYFj5V0JH6WvjXv62ngWDK9PfWOM+8mrbGUa0IOdiCQbY+LKux6+SF8b9/S18Uxfn0s05aKUUgFCA7pSSgUIDehla1Z5V8CH6Wvjnr42nunrY9MculJKBQhtoSulVIDQgK6UUgFCA3oZEJG9IrJFRFJEJLm861PeROQ9ETkiIludtkWLyDIR+dX+v0Z51rG8uHlt4kUk1X7/pIhI9/KsY3kRkatEZKWI/Cwi20RkhL1d3zs2Dehlp5MxpqX2lwVgLpB/4ddngOXGmMbAcvvnYDSXgq8NwGv2+6elMebrMq6Tr7gAjDTGXAe0AR4Tkaboe+ciDeiqzBlj1gDH823uBXxgP/4A6F2mlfIRbl4bBRhj0owxP9qPTwM/AzHoe+ciDehlwwBJIrJRRAaXd2V8VB1jTBpYf7hA7XKuj68ZLiKb7ZRM0KYUHESkAdAK2IC+dy7SgF422hljbgT+hvU18a/lXSHlV94GGgEtgTTglfKtTvkSkSrAYuAJY8yp8q6PL9GAXgaMMQft/48AnwE3lW+NfNJhEakLYP9/pJzr4zOMMYeNMTnGmFxgNkH8/hGRMKxgPt8Ys8TerO8dmwb0UiYikSJS1fEY6Aps9XxWUPoCeNB+/CDweTnWxac4gpXtToL0/SMiAswBfjbGvOq0S987Nh0pWspE5M9YrXKwFuX+2BgzpRyrVO5EZAHQEWva08PARCABWAjEAvuAu40xQXdz0M1r0xEr3WKAvcAQR844mIhIe+B/gS1Arr15LFYePejfO6ABXSmlAoamXJRSKkBoQFdKqQChAV0ppQKEBnSllAoQGtCVUipAaEBXSqkAoQFdKaUCxP8HsGgj+O+z9tIAAAAASUVORK5CYII=\n"
          },
          "metadata": {
            "needs_background": "light"
          }
        }
      ],
      "execution_count": 9,
      "metadata": {
        "collapsed": true,
        "jupyter": {
          "source_hidden": false,
          "outputs_hidden": false
        },
        "nteract": {
          "transient": {
            "deleting": false
          }
        },
        "execution": {
          "iopub.status.busy": "2021-09-12T04:14:58.836Z",
          "iopub.execute_input": "2021-09-12T04:14:58.848Z",
          "shell.execute_reply": "2021-09-12T04:14:58.968Z",
          "iopub.status.idle": "2021-09-12T04:14:58.938Z"
        }
      }
    },
    {
      "cell_type": "code",
      "source": [
        "def evaluate_model(X, y, model):\n",
        "\t# Define model evaluation\n",
        "\tcv = RepeatedKFold(n_splits=10, n_repeats=3, random_state=1)\n",
        "\t# Evaluate model\n",
        "\tscores = cross_val_score(model, X, y, scoring='neg_mean_absolute_error', cv=cv, n_jobs=-1)\n",
        "\t# Scores to be positive\n",
        "\treturn absolute(scores)"
      ],
      "outputs": [],
      "execution_count": 10,
      "metadata": {
        "collapsed": true,
        "jupyter": {
          "source_hidden": false,
          "outputs_hidden": false
        },
        "nteract": {
          "transient": {
            "deleting": false
          }
        },
        "execution": {
          "iopub.status.busy": "2021-09-12T04:14:58.944Z",
          "iopub.execute_input": "2021-09-12T04:14:58.947Z",
          "iopub.status.idle": "2021-09-12T04:14:58.954Z",
          "shell.execute_reply": "2021-09-12T04:14:58.971Z"
        }
      }
    },
    {
      "cell_type": "code",
      "source": [
        "results = evaluate_model(X, y, model) \n",
        "print('Average MAE: %.3f (%.3f)' % (results.mean(), results.std())) "
      ],
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "Average MAE: 0.146 (0.019)\n"
          ]
        }
      ],
      "execution_count": 11,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false,
        "execution": {
          "iopub.status.busy": "2021-09-12T04:14:58.960Z",
          "iopub.execute_input": "2021-09-12T04:14:58.990Z",
          "iopub.status.idle": "2021-09-12T04:15:03.797Z",
          "shell.execute_reply": "2021-09-12T04:15:03.805Z"
        }
      }
    },
    {
      "cell_type": "code",
      "source": [
        "model.predict(y)"
      ],
      "outputs": [
        {
          "output_type": "execute_result",
          "execution_count": 14,
          "data": {
            "text/plain": "array([[ 4.00128085],\n       [ 4.13128879],\n       [ 4.18129151],\n       ...,\n       [20.9022979 ],\n       [22.29238288],\n       [23.98248325]])"
          },
          "metadata": {}
        }
      ],
      "execution_count": 14,
      "metadata": {
        "collapsed": true,
        "jupyter": {
          "source_hidden": false,
          "outputs_hidden": false
        },
        "nteract": {
          "transient": {
            "deleting": false
          }
        },
        "execution": {
          "iopub.status.busy": "2021-09-12T04:15:03.891Z",
          "iopub.execute_input": "2021-09-12T04:15:03.895Z",
          "iopub.status.idle": "2021-09-12T04:15:03.904Z",
          "shell.execute_reply": "2021-09-12T04:15:03.932Z"
        }
      }
    },
    {
      "cell_type": "code",
      "source": [
        "from sklearn.metrics import r2_score \n",
        "r2_score(X,y)"
      ],
      "outputs": [
        {
          "output_type": "execute_result",
          "execution_count": 15,
          "data": {
            "text/plain": "0.9976522993458272"
          },
          "metadata": {}
        }
      ],
      "execution_count": 15,
      "metadata": {
        "collapsed": true,
        "jupyter": {
          "source_hidden": false,
          "outputs_hidden": false
        },
        "nteract": {
          "transient": {
            "deleting": false
          }
        },
        "execution": {
          "iopub.status.busy": "2021-09-12T04:15:03.910Z",
          "iopub.execute_input": "2021-09-12T04:15:03.915Z",
          "iopub.status.idle": "2021-09-12T04:15:03.924Z",
          "shell.execute_reply": "2021-09-12T04:15:03.936Z"
        }
      }
    },
    {
      "cell_type": "code",
      "source": [
        "y_pred = model.predict(y)"
      ],
      "outputs": [],
      "execution_count": 19,
      "metadata": {
        "collapsed": true,
        "jupyter": {
          "source_hidden": false,
          "outputs_hidden": false
        },
        "nteract": {
          "transient": {
            "deleting": false
          }
        },
        "execution": {
          "iopub.status.busy": "2021-09-12T04:17:32.584Z",
          "iopub.execute_input": "2021-09-12T04:17:32.590Z",
          "iopub.status.idle": "2021-09-12T04:17:32.598Z",
          "shell.execute_reply": "2021-09-12T04:17:32.604Z"
        }
      }
    },
    {
      "cell_type": "code",
      "source": [
        "y_pred.shape"
      ],
      "outputs": [
        {
          "output_type": "execute_result",
          "execution_count": 20,
          "data": {
            "text/plain": "(1170, 1)"
          },
          "metadata": {}
        }
      ],
      "execution_count": 20,
      "metadata": {
        "collapsed": true,
        "jupyter": {
          "source_hidden": false,
          "outputs_hidden": false
        },
        "nteract": {
          "transient": {
            "deleting": false
          }
        },
        "execution": {
          "iopub.status.busy": "2021-09-12T04:17:34.547Z",
          "iopub.execute_input": "2021-09-12T04:17:34.552Z",
          "iopub.status.idle": "2021-09-12T04:17:34.562Z",
          "shell.execute_reply": "2021-09-12T04:17:34.568Z"
        }
      }
    },
    {
      "cell_type": "code",
      "source": [
        "data = {'Actual':y.flatten(), 'Predicted':y_pred.flatten()}"
      ],
      "outputs": [],
      "execution_count": 29,
      "metadata": {
        "collapsed": true,
        "jupyter": {
          "source_hidden": false,
          "outputs_hidden": false
        },
        "nteract": {
          "transient": {
            "deleting": false
          }
        },
        "execution": {
          "iopub.status.busy": "2021-09-12T04:21:06.459Z",
          "iopub.execute_input": "2021-09-12T04:21:06.465Z",
          "iopub.status.idle": "2021-09-12T04:21:06.475Z",
          "shell.execute_reply": "2021-09-12T04:21:06.483Z"
        }
      }
    },
    {
      "cell_type": "code",
      "source": [
        "df = pd.DataFrame(data)\n",
        "print(df.head())\n",
        "print(df.tail())"
      ],
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "   Actual  Predicted\n",
            "0    4.00   4.001281\n",
            "1    4.13   4.131289\n",
            "2    4.18   4.181292\n",
            "3    4.18   4.181292\n",
            "4    4.09   4.091286\n",
            "         Actual  Predicted\n",
            "1165  19.980000  19.982242\n",
            "1166  20.400000  20.402268\n",
            "1167  20.900000  20.902298\n",
            "1168  22.290001  22.292383\n",
            "1169  23.980000  23.982483\n"
          ]
        }
      ],
      "execution_count": 31,
      "metadata": {
        "collapsed": true,
        "jupyter": {
          "source_hidden": false,
          "outputs_hidden": false
        },
        "nteract": {
          "transient": {
            "deleting": false
          }
        },
        "execution": {
          "iopub.status.busy": "2021-09-12T04:21:26.408Z",
          "iopub.execute_input": "2021-09-12T04:21:26.420Z",
          "iopub.status.idle": "2021-09-12T04:21:26.435Z",
          "shell.execute_reply": "2021-09-12T04:21:26.441Z"
        }
      }
    }
  ],
  "metadata": {
    "kernel_info": {
      "name": "python3"
    },
    "language_info": {
      "name": "python",
      "version": "3.6.13",
      "mimetype": "text/x-python",
      "codemirror_mode": {
        "name": "ipython",
        "version": 3
      },
      "pygments_lexer": "ipython3",
      "nbconvert_exporter": "python",
      "file_extension": ".py"
    },
    "kernelspec": {
      "name": "python3",
      "language": "python",
      "display_name": "Python 3"
    },
    "nteract": {
      "version": "0.28.0"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 4
}